<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>slarf.f</title>
 <meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!-- 
body { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default   { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default a { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.string   { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.string a { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.comment   { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.comment a { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
 --></style>

 </head>
  <body>

<pre>
      SUBROUTINE <a name="SLARF.1"></a><a href="slarf.f.html#SLARF.1">SLARF</a>( SIDE, M, N, V, INCV, TAU, C, LDC, WORK )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK auxiliary routine (version 3.1) --
</span><span class="comment">*</span><span class="comment">     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment">     November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Scalar Arguments ..
</span>      CHARACTER          SIDE
      INTEGER            INCV, LDC, M, N
      REAL               TAU
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      REAL               C( LDC, * ), V( * ), WORK( * )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Purpose
</span><span class="comment">*</span><span class="comment">  =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="SLARF.19"></a><a href="slarf.f.html#SLARF.1">SLARF</a> applies a real elementary reflector H to a real m by n matrix
</span><span class="comment">*</span><span class="comment">  C, from either the left or the right. H is represented in the form
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        H = I - tau * v * v'
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  where tau is a real scalar and v is a real vector.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  If tau = 0, then H is taken to be the unit matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Arguments
</span><span class="comment">*</span><span class="comment">  =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  SIDE    (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          = 'L': form  H * C
</span><span class="comment">*</span><span class="comment">          = 'R': form  C * H
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  M       (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of rows of the matrix C.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  N       (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of columns of the matrix C.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  V       (input) REAL array, dimension
</span><span class="comment">*</span><span class="comment">                     (1 + (M-1)*abs(INCV)) if SIDE = 'L'
</span><span class="comment">*</span><span class="comment">                  or (1 + (N-1)*abs(INCV)) if SIDE = 'R'
</span><span class="comment">*</span><span class="comment">          The vector v in the representation of H. V is not used if
</span><span class="comment">*</span><span class="comment">          TAU = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  INCV    (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The increment between elements of v. INCV &lt;&gt; 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  TAU     (input) REAL
</span><span class="comment">*</span><span class="comment">          The value tau in the representation of H.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  C       (input/output) REAL array, dimension (LDC,N)
</span><span class="comment">*</span><span class="comment">          On entry, the m by n matrix C.
</span><span class="comment">*</span><span class="comment">          On exit, C is overwritten by the matrix H * C if SIDE = 'L',
</span><span class="comment">*</span><span class="comment">          or C * H if SIDE = 'R'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDC     (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array C. LDC &gt;= max(1,M).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK    (workspace) REAL array, dimension
</span><span class="comment">*</span><span class="comment">                         (N) if SIDE = 'L'
</span><span class="comment">*</span><span class="comment">                      or (M) if SIDE = 'R'
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  =====================================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Parameters ..
</span>      REAL               ONE, ZERO
      PARAMETER          ( ONE = 1.0E+0, ZERO = 0.0E+0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           SGEMV, SGER
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      LOGICAL            <a name="LSAME.75"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
      EXTERNAL           <a name="LSAME.76"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span>      IF( <a name="LSAME.80"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'L'</span> ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        Form  H * C
</span><span class="comment">*</span><span class="comment">
</span>         IF( TAU.NE.ZERO ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">           w := C' * v
</span><span class="comment">*</span><span class="comment">
</span>            CALL SGEMV( <span class="string">'Transpose'</span>, M, N, ONE, C, LDC, V, INCV, ZERO,
     $                  WORK, 1 )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">           C := C - v * w'
</span><span class="comment">*</span><span class="comment">
</span>            CALL SGER( M, N, -TAU, V, INCV, WORK, 1, C, LDC )
         END IF
      ELSE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        Form  C * H
</span><span class="comment">*</span><span class="comment">
</span>         IF( TAU.NE.ZERO ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">           w := C * v
</span><span class="comment">*</span><span class="comment">
</span>            CALL SGEMV( <span class="string">'No transpose'</span>, M, N, ONE, C, LDC, V, INCV,
     $                  ZERO, WORK, 1 )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">           C := C - w * v'
</span><span class="comment">*</span><span class="comment">
</span>            CALL SGER( M, N, -TAU, WORK, 1, V, INCV, C, LDC )
         END IF
      END IF
      RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     End of <a name="SLARF.113"></a><a href="slarf.f.html#SLARF.1">SLARF</a>
</span><span class="comment">*</span><span class="comment">
</span>      END

</pre>

 </body>
</html>
